import Vue from "vue";
import Vuex from "vuex";
// 引入数据持久化插件
import persistence from 'vuex-uniapp-persistence'
// 引入子模块
import user from "./user";
import address from "./address";
Vue.use(Vuex);
const store = new Vuex.Store({
  //注册持久化插件
  plugins:[persistence()],
  state: {
    // 系统信息安全区域
    SafeArea:uni.getSystemInfoSync().safeArea,
    // 获取用户设备类型,系统型号
    platform:wx.getSystemInfoSync().platform


  },
  getters: {},
  mutations: {
  },
  modules: { 
    // 添加子模块
    user,
    address
  },
});
export default store;
